cmake_minimum_required(VERSION 3.0.2)
project(image_stitch)


###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations


# find_package(OpenCV REQUIRED)

# find_package(OpenCV 3.0 QUIET)
# if(NOT OpenCV_FOUND)
#    find_package(OpenCV 2.4.3 QUIET)
#    if(NOT OpenCV_FOUND)
#       message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
#    endif()
# endif()
find_package(OpenCV)
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)

# Set(OPENCV_ENABLE_NONFREE true)
# find_package(Eigen3 3.1.0 REQUIRED)
# find_package(Pangolin REQUIRED)
# find_package(PCL 1.7 REQUIRED )

include_directories(
  ./src
# INCLUDE_DIRECTORIES("/home/yourusername/Dependencies/opencv-3.4.9/opencv_contrib-3.4.9/modules/xfeatures2d/include")
# ${catkin_INCLUDE_DIRS}
# ${PROJECT_SOURCE_DIR}
# ${Pangolin_INCLUDE_DIRS}
# ${PCL_INCLUDE_DIRS}
# ${Qt5Widgets_LIBRARIES}
# ../src
)

add_definitions( ${PCL_DEFINITIONS} )
link_directories( ${PCL_LIBRARY_DIRS} )
message(${OpenCV_LIBS})
set(LIBS 
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${catkin_LIBRARIES}
${PCL_LIBRARIES}
# /usr/local/lib/libopencv_xfeatures2d.so.4.5.2
# -lboost_system
)

# add_executable(sort_algo
# src/image_stitch.cpp
# src/sort_algo.cpp
# )
# target_link_libraries(sort_algo ${LIBS} )




set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# QtCreator supports the following variables for Android, which are identical to qmake Android variables.
# Check http://doc.qt.io/qt-5/deployment-android.html for more information.
# They need to be set before the find_package(Qt5 ...) call.

#if(ANDROID)
#    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
#    if (ANDROID_ABI STREQUAL "armeabi-v7a")
#        set(ANDROID_EXTRA_LIBS
#            ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so
#            ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so)
#    endif()
#endif()

find_package(Qt5 COMPONENTS Widgets REQUIRED)

add_executable(gui
  gui/gui.cpp
  src/image_stitch.cpp
  src/sort_algo.cpp
  # widget.cpp
  # widget.h
  # widget.ui
)

target_link_libraries(gui  PRIVATE Qt5::Widgets ${LIBS})

add_executable(test
  src/test.cpp
  src/image_stitch.cpp
  src/sort_algo.cpp
  # widget.cpp
  # widget.h
  # widget.ui
)

target_link_libraries(test  PRIVATE Qt5::Widgets ${LIBS})